import React, {Component} from 'react';
import {HashRouter, Switch, Route, Redirect} from 'react-router-dom';
import asyncComponent from '../utils/asyncComponent';

import Main from '../pages/App'
const Login = asyncComponent(() => import("../pages/common/login/login"));
const FindPsd = asyncComponent(() => import("../pages/common/findPsd/findPsd"));

export default class RouteConfig extends Component {
    render() {
        return (
            <HashRouter>
                <Switch>
                    {<Route path="/" exact render={() => (<Redirect to="/index" />)} />}
                    <Route path="/index" component={Main}/>
                    <Route path="/login" component={Login}/>
                    <Route path="/findPsd" component={FindPsd}/>
                </Switch>
            </HashRouter>
        )
    }
}
